home *** CD-ROM | disk | FTP | other *** search
- Path: newsbf02.news.aol.com!not-for-mail
- From: blumenberg@aol.com (Blumenberg)
- Newsgroups: comp.lang.c++
- Subject: Printing fixed length char arrays in C++?
- Date: 18 Apr 1996 11:51:01 -0400
- Organization: America Online, Inc. (1-800-827-6364)
- Sender: root@newsbf02.news.aol.com
- Message-ID: <4l5od5$7kg@newsbf02.news.aol.com>
- Reply-To: blumenberg@aol.com (Blumenberg)
- NNTP-Posting-Host: newsbf02.mail.aol.com
-
- How do I print fixed length char arrays (not null-term'ed strings) in C++?
-
- In C I would use something like:
- char abc[3] = {'a','b','c'};
- printf("result=%.*s\n",sizeof abc,abc);
-
- How would I do this in C++ iostreams? I tried playing with setw() and
- setprecision(), but they don't produce the desired effect.
- Any suggestions?
- Thanks,
- Dwayne
- blumenberg@aol.com
-